Skip to content

fix: pin axios exactly so consumers cannot resolve an uncached release - #263

Closed
ChenMachBase wants to merge 1 commit into
mainfrom
pin-axios-exact
Closed

fix: pin axios exactly so consumers cannot resolve an uncached release#263
ChenMachBase wants to merge 1 commit into
mainfrom
pin-axios-exact

Conversation

@ChenMachBase

Copy link
Copy Markdown
Contributor

What and why

axios: "^1.18.1"axios: "1.18.1". The resolved version does not change — the lockfile has always said 1.18.1.

A library's lockfile does not constrain its consumers. Deno and Cloudflare Workers resolve npm:@base44/sdk@x.y.z against this package.json's range, so the caret meant every generated-function redeploy picked whatever 1.x npm had published most recently.

The outage this caused

axios 1.20.0 shipped. Redeploys began resolving it, and the Deno runtime runs --cached-only against a cache warmed with 1.18.1, so any edited function 502'd on cold start while untouched warm functions kept serving. Two automations auto-paused after consecutive failures (recoverStuckProcessingOrders, createAbandonmentCoupon). The reported error is exactly this: npm package not found in cache: "axios", --cached-only is specified.

Supply-chain angle

This repo's minimumReleaseAge gives a 7-day cooldown, but that applies at our install time. A consumer resolving a caret at deploy time gets a package published minutes ago with no cooldown at all — the hazard apper's CLAUDE.md calls out for npm: specifiers.

Scope

  • Inert for anything installing from the lockfile (npm ci verified consistent, resolved version identical).
  • Only changes what an npm: consumer resolves — which is the point.
  • 236 tests pass, typecheck and eslint clean.

Does NOT fix the live incident

Functions already generated pin @base44/sdk@0.8.40, whose published package.json still carries the caret and is immutable. The Deno npm cache still needs axios@1.20.0 warmed to recover those. This closes the hole for functions generated after the next release.

A library's lockfile does not constrain its consumers. Deno and Cloudflare
Workers resolve `npm:@base44/sdk@x.y.z` against this package.json's range, not
against package-lock.json — so `^1.18.1` meant every function redeploy picked
whatever 1.x npm had published most recently, even though the lockfile here has
always said 1.18.1.

That took down generated backend functions today: axios 1.20.0 shipped, redeploys
started resolving it, and the Deno runtime runs `--cached-only` against a cache
warmed with 1.18.1 — so any edited function 502'd on cold start while untouched
warm functions kept serving.

It is also a supply-chain gap. `minimumReleaseAge` gives this repo a 7-day
cooldown on new releases, but that applies at *our* install time; a consumer
resolving a caret at deploy time gets a package published minutes ago with no
cooldown at all.

The resolved version is unchanged (1.18.1, exactly what the lockfile already
pinned), so this is inert for anything installing from the lockfile and only
changes what a `npm:` consumer resolves.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/sdk@0.8.44-pr.263.808bbc2

Prefer not to change any import paths? Install using npm alias so your code still imports @base44/sdk:

npm i "@base44/sdk@npm:@base44-preview/sdk@0.8.44-pr.263.808bbc2"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "@base44/sdk": "npm:@base44-preview/sdk@0.8.44-pr.263.808bbc2"
  }
}

Preview published to npm registry — try new features instantly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant